# Build the project
Write-Host "Building linter..." -ForegroundColor Cyan
npm run build >$null
if ($LASTEXITCODE -ne 0) {
    Write-Host "Build failed, abort" -ForegroundColor Red
    exit
}

# Check if the target file exists
$target = "dist/index.js";
if (-not (Test-Path $target)) {
    Write-Host "File $targetFile does not exist" -ForegroundColor Red
    exit
}

# echo a separator
Write-Host "----------------------------------------"

# run the target file with rest of the arguments
node $target $args[1..($args.Length - 1)]
